{% extends 'base.html' %}

{% block stylesheet %}
{{ block.super }}
{% endblock%}

{% block javascript %}
{{ block.super }}
<script type="text/javascript" src="{% url base_static "js/jquery.tablesorter.min.js" %}"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#invoice_table").tablesorter();
    $("table.list tr:even").addClass("even");

    $("#unregistered-school-h").click(function(){
        $("#unregistered-school").toggle();
    });
    $("#unregistered-school").hide();
});
</script>
{% endblock%}

{% block content %}
{% load humanize %}
<h3>Invoice List</h3>
<div id="navi">
    <ul>
        <li><a href="{% url invoice_create %}">invoice create</a></li>
        <li><a href="{% url invoice_year_list "2011" %}">2011 Invoice list</a></li>
    </ul>
</div>
{% load gae_filters %}
<h3>{{ month|en_month:"f" }} / {{ year }} Summary</h3>
<table id="invoice_summary_table" class="tablesorter list">
<thead>
    <tr>
        <th>Total Class Count</th>
        <th>Total Paid</th>
        <th>Paid School Count</th>
        <th>Total Unpaid</th>
        <th>Unpaid School Count</th>
        <th>Total E-Teacher Payment</th>
        <th>Total</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td>{{ total_class_count }}</td>
        <td>{{ paid|intcomma }}</td>
        <td>{{ paid_school }}</td>
        <td>{{ unpaid|intcomma }}</td>
        <td>{{ unpaid_school }}</td>
        <td>{{ eteacher_pay|intcomma }}</td>
        <td>{{ total_paid|intcomma }}</td>
    </tr>
</tbody>
</table>

<h3 id="unregistered-school-h">Unregistered School({{ unregistered_schools|length }})</h3>
<div id="unregistered-school">
    {% for school in unregistered_schools %}
        <a href="{% url invoice_create %}?school={{ school.id }}&month={{ month }}">{{ school.name }}_{{ school.stage }}</a> &#124;
    {% endfor %}
</div>

<h3>All Invoice({{ invoices|length }})</h3>
{% include "temp_invoice/_list.html" %}

{% endblock %}